<?php
require_once "../config/app.config.php";
$entity = new EntityBLL();
$user = new UserBLL();
try
{
    $entitydvo = $entity->GetBaseByID($_GET["__id"], true);
} catch(Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
$fieldsDAO = new EntityFieldDAO();
$fields = $fieldsDAO->GetAllByEntityID($entitydvo->getID(), "FormLocation", true);
/*
foreach($entitydvo->getFields() as $field){
	$fieldArr = array();
	$field = EntityFieldDVO::cast($field);
	$fieldArr["Name"] = $field->getName();
	$fieldArr["DbField"] = $field->getDbField();
	$fieldArr["FormLocation"] = $field->getFormLocation();
	$fieldArr["FormLocation"] = $field->getCustomProperties();
	array_push($fields, $fieldArr);
}
*/
vp($fields);
?>
<form>
	<table>
		<tr>
			<td><b>ID</b></td>
			<td><?=$entitydvo->getID()?></td>
		</tr>
		<tr>
			<td><b>Name</b></td>
			<td><input type="text" value="<?=$entitydvo->getName()?>"/></td>
		</tr>
		<tr>
			<td><b>Label</b></td>
			<td><input type="text" value="<?=$entitydvo->getLabel()?>"/></td>
		</tr>
		<tr>
			<td><b>Plural Label</b></td>
			<td><input type="text" value="<?=$entitydvo->getPluralLabel()?>"/></td>
		</tr>
		<tr>
			<td><b>Table Name</b></td>
			<td><?=$entitydvo->getTableName()?></td>
		</tr>
		<tr>
			<td><b>Created By</b></td>
			<td>
				<?=$user->getByID($entitydvo->getCreatedBy())->getName()?>
			</td>
		</tr>
		<tr>
			<td><b>Created Date</b></td>
			<td><?=$entitydvo->getCreatedDate()?></td>
		</tr>
		<tr>
			<td><b>Modified By</b></td>
			<td>
				<?=$user->getByID($entitydvo->getModifiedBy())->getName()?>
			</td>
		</tr>
		<tr>
			<td><b>Modified Date</b></td>
			<td><?=$entitydvo->getModifiedDate()?></td>
		</tr>
		<tr>
			<td><b>Owner</b></td>
			<td>
				<?=$user->getByID($entitydvo->getOwnerID())->getName()?>
			</td>
		</tr>
		<tr>
			<td><b>Group ID</b></td>
			<td><?=$entitydvo->getGroupID()?></td>
		</tr>
		<tr>
			<td><b>Status</b></td>
			<td><?=$entitydvo->getStatus()?></td>
		</tr>
		<tr>
			<td><b>Access</b></td>
			<td><?=$entitydvo->getU()?><?=$entitydvo->getG()?><?=$entitydvo->getW()?></td>
		</tr>
	</table>
</form>